package com.jc.ds.model;

import java.util.Date;

/**
 * public_img
 * @author 
 */
public class PublicImg extends BaseValueObject {
    /**
     * id
     */
    private Long id;

    /**
     * 图片URL
     */
    private String url;

    /**
     * 图片高度
     */
    private Double height;

    /**
     * 图片宽度
     */
    private Double width;

    /**
     * 图片类型 0 : 退货图片
     */
    private String type;

    /**
     * 业务Id
     */
    private Long businessId;

    /**
     * 排序
     */
    private Long sort;

    /**
     * 是否删除 'N' 没有删除 'Y' 已经删除
     */
    private String isDelete;

    /**
     * 创建时间
     */
    private Date createTime;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    public Double getWidth() {
        return width;
    }

    public void setWidth(Double width) {
        this.width = width;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getBusinessId() {
        return businessId;
    }

    public void setBusinessId(Long businessId) {
        this.businessId = businessId;
    }

    public Long getSort() {
        return sort;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }

    public String getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByUrl(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by url asc";
            }else{
                this.orderStr = this.orderStr + ",url asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by url desc";
            }else{
                this.orderStr = this.orderStr + ",url desc";
            }
        }
    }

    public void orderByHeight(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by height asc";
            }else{
                this.orderStr = this.orderStr + ",height asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by height desc";
            }else{
                this.orderStr = this.orderStr + ",height desc";
            }
        }
    }

    public void orderByWidth(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by width asc";
            }else{
                this.orderStr = this.orderStr + ",width asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by width desc";
            }else{
                this.orderStr = this.orderStr + ",width desc";
            }
        }
    }

    public void orderByType(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by type asc";
            }else{
                this.orderStr = this.orderStr + ",type asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by type desc";
            }else{
                this.orderStr = this.orderStr + ",type desc";
            }
        }
    }

    public void orderByBusinessId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by business_id asc";
            }else{
                this.orderStr = this.orderStr + ",business_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by business_id desc";
            }else{
                this.orderStr = this.orderStr + ",business_id desc";
            }
        }
    }

    public void orderBySort(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by sort asc";
            }else{
                this.orderStr = this.orderStr + ",sort asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by sort desc";
            }else{
                this.orderStr = this.orderStr + ",sort desc";
            }
        }
    }

    public void orderByIsDelete(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by is_delete asc";
            }else{
                this.orderStr = this.orderStr + ",is_delete asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by is_delete desc";
            }else{
                this.orderStr = this.orderStr + ",is_delete desc";
            }
        }
    }

    public void orderByCreateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by create_time asc";
            }else{
                this.orderStr = this.orderStr + ",create_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by create_time desc";
            }else{
                this.orderStr = this.orderStr + ",create_time desc";
            }
        }
    }
}